﻿
namespace LM.TesteUnitario
{
    using LM.InterfacesFabricas.Fabricas;
    using LM.InterfacesFabricas.Interfaces.Servicos;
    using NUnit.Framework;
    using Rhino.Mocks;
    using System;

    [TestFixture]
    public class TestesServicoTeste
    {
        [Test]
        public void TesteObtenhaDataHoraAtual()
        {
            var servicoTeste = FabricaGenerica.Crie<IServicoTeste>();

            Assert.IsNotNull(servicoTeste);
        }

        [Test]
        public void TesteObtenhaDataHoraAtual_Mock()
        {
            var mocker = new MockRepository();

            var servicoTeste = mocker.Stub<IServicoTeste>();

            using (mocker.Record())
            {
                servicoTeste.ObtenhaDataHoraAtual();
                LastCall.Return(ObtenhaDataHoraAtual_Mock());
            }

            Assert.AreEqual(servicoTeste.ObtenhaDataHoraAtual(), DateTime.MaxValue);
        }

        private DateTime ObtenhaDataHoraAtual_Mock()
        {
            return DateTime.MaxValue;
        }
    }
}
